const path = require('path');
const webpack = require('webpack');

module.exports = {
	entry: './src/index.js',
	module: {
		rules: [
			{
				test: /\.(ttf|png|jpeg|jpg|svg|eot)(\?\w+)?$/,
				use: [
					{
						loader: 'url-loader',
						options: {
							limit: 8192
						}
					},
				],
				include: path.resolve(__dirname, 'src')
			},
			{
				test: /\.less$/,
				use: [
					'style-loader',
					'css-loader',
					{
            loader: "less-loader", options: {
                sourceMap: false
            }
           }
				],
				include: path.resolve(__dirname, 'src'),
			},
			{
				test: /\.css$/,
				use: [
					'style-loader',
					'css-loader'
				],
			},
			{
				test: /\.js$/,
				use: {
					loader: 'babel-loader',
					options: {
						presets: ['stage-1', 'react'],
						cacheDirectory: true,
						babelrc: false
					}
				},
				include: path.resolve(__dirname, 'src'),
			}
		]
	}
}